
CC = gcc
DEBUG =    -g   -Wall  -O2
LIBS = -lm -lz -lpthread  -L/usr/local/lib -lhts 

 
CFLAGS?= $(DEBUG) -Wall -D_FILE_OFFSET_BITS=64 -pthread $(INCLUDE)

BIN=bamTools bamSort bamMultiSort bamMIOSort

all:$(BIN)


bamMultiSortobj=bamMultiSort.o bamMultiSortCore.o  utils.o

bamObj= main.o 

bamSortObj= bamSort.o sortCore.o   utils.o

bamMIOSortObj= bamMIOSort.o bamMIOSortCore.o  utils.o kthread.o


bamTools: $(bamObj)
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)   


bamSort: $(bamSortObj)
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

bamMultiSort: $(bamMultiSortobj)
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

bamMIOSort:$(bamMIOSortObj)

	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)




clean:
	-rm  -f $(BIN)  *o  *~  *.s  gmon.out
